package com.example.imoocmall.model.request;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 添加目录
 */
@Data
public class UpdateCategoryReq {

    @NotNull(message = "id不能为空")
    private Integer id;

    @Size(min = 2,max = 5,message = "类别名称的长度必须在2和5之间")
    @NotNull(message = "类别名不能为空")
    private String name;

    @NotNull(message = "类别级别不能为空")
    @Max(value = 3,message = "分类目录级别不能大于3")
    private Integer type;

    @NotNull(message = "上级类别id不能为空")
    private Integer parentId;

    @NotNull(message = "目录排序不能为空")
    private Integer orderNum;
}
